﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Faker;
using NUnit.Framework;
using System.Text.RegularExpressions;

namespace Faker.Test {
    [TestFixture]
    public class FakerFixture {
        
        [Test]
        public void TestNumerify() {
            var result = Faker.Numerify("###");
            var reg = new Regex(@"\d{3}");
            Assert.True(reg.IsMatch(result));

            result = Faker.Numerify("a###z");
            reg = new Regex(@"a\d{3}z");
            Assert.True(reg.IsMatch(result));
        }

        [Test]
        public void TestLetterify() {
            var result = Faker.Letterify("???");
            var reg = new Regex(@"[a-z]{3}");
            Assert.True(reg.IsMatch(result));

            result = Faker.Letterify("1???5");
            reg = new Regex(@"1[a-z]{3}5");
            Assert.True(reg.IsMatch(result));

        }

        [Test]
        public void TestBothify() {
            var result = Faker.Bothify("#???#");
            var reg = new Regex(@"\d[a-z]{3}\d");
            Assert.True(reg.IsMatch(result));
        }

    }
}
